# Contributor: Lindsay Zhou <i@lin.moe>
# Maintainer: Lindsay Zhou <i@lin.moe>
pkgname=fcitx5-m17n
pkgver=5.1.2
pkgrel=0
pkgdesc="m17n extra input method support for fcitx5"
url="https://github.com/fcitx/fcitx5-m17n"
arch="all"
license="LGPL-2.1-or-later"
makedepends="
	cmake
	extra-cmake-modules
	gettext-dev
	fcitx5-dev
	fmt-dev
	m17n-lib-dev
	samurai
	"
subpackages="$pkgname-lang"
source="$pkgname-$pkgver.tar.gz::https://github.com/fcitx/fcitx5-m17n/archive/refs/tags/$pkgver.tar.gz"
# Upstream test makes defective assumptions.
options="!check"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DENABLE_TEST="$(want_check && echo ON || echo OFF)"
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
9e9516201f5f57701356f65c85328e95f82f399a5c5985401a1d55a4a9fc70d3bab3bd85a371c4583736e394c4d4b90fa9b2d3afd5eb43c93dd81986b871d4d4  fcitx5-m17n-5.1.2.tar.gz
"
